<?php namespace Modules\Shop\Http\Controllers;


class RegionController extends Controller {

    public function getIndex()
    {
        global $_CFG, $ecs, $err, $smarty, $_LANG, $db;


        header('Content-type: text/html; charset=' . EC_CHARSET);

        $type = \Input::get('type') ? intval(\Input::get('type')) : 0;
        $parent = \Input::get('parent') ? intval(\Input::get('parent')) : 0;

        $arr['regions'] = get_regions($type, $parent);
        $arr['type'] = $type;
        $arr['target'] = \Input::get('target') ? stripslashes(trim(\Input::get('target'))) : '';
        $arr['target'] = htmlspecialchars($arr['target']);

        $json = new \JSON;
        echo $json->encode($arr);
		return view('shop::index');
	}
	
}